<%@ include file="/jsp/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>index.jsp</title>
<script type="text/javascript" src="<c:url value="/scripts/json2.js"/>"></script>
<script type="text/javascript" src="<c:url value="/script/jquery-1.4.2.min.js"/>"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#userName_input").change(
				function(){
					//ajax check whether the use is exists
					$.ajax({
						  url: '<c:url value="/user/checkUser.action"/>',
						  data: "userName=" + $("#userName_input").attr("value"),
						  success: function(data) {
							  
							  $("#tips").show();
						  },
					error: function(XMLHttpRequest, textStatus, exception) {
						  alert(XMLHttpRequest + ";" + textStatus + ";" + exception);
					  }
						});

				}
		);
		
		
		
	});

</script>
</head>
<body>
<s:form action="login" method="post" namespace="/user">
	<s:textfield id="userName_input" name="userName" label="username" />
	<s:textfield name="password" label="password" />
	<s:submit value="login" />
	<div id="tips" style="display:none">
		The user Name that you inputed is not exist.
	</div>
</s:form>
</body>
</html>